/**
 * <copyright>
 * </copyright>
 *

 */
package sk.scerbak.ucl.usecases.usecases.impl;

import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EDataType;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EPackage;

import org.eclipse.emf.ecore.impl.EFactoryImpl;

import org.eclipse.emf.ecore.plugin.EcorePlugin;

import sk.scerbak.ucl.usecases.usecases.Action;
import sk.scerbak.ucl.usecases.usecases.ActionStep;
import sk.scerbak.ucl.usecases.usecases.Actor;
import sk.scerbak.ucl.usecases.usecases.AllStepsSelector;
import sk.scerbak.ucl.usecases.usecases.AnyAction;
import sk.scerbak.ucl.usecases.usecases.Condition;
import sk.scerbak.ucl.usecases.usecases.Extension;
import sk.scerbak.ucl.usecases.usecases.ExtensionStep;
import sk.scerbak.ucl.usecases.usecases.Goto;
import sk.scerbak.ucl.usecases.usecases.Interaction;
import sk.scerbak.ucl.usecases.usecases.Interest;
import sk.scerbak.ucl.usecases.usecases.Issue;
import sk.scerbak.ucl.usecases.usecases.Level;
import sk.scerbak.ucl.usecases.usecases.Model;
import sk.scerbak.ucl.usecases.usecases.ScenarioEnd;
import sk.scerbak.ucl.usecases.usecases.ScenarioResult;
import sk.scerbak.ucl.usecases.usecases.Scope;
import sk.scerbak.ucl.usecases.usecases.ScopeType;
import sk.scerbak.ucl.usecases.usecases.SingleStepSelector;
import sk.scerbak.ucl.usecases.usecases.State;
import sk.scerbak.ucl.usecases.usecases.StepListSelector;
import sk.scerbak.ucl.usecases.usecases.StepRangeSelector;
import sk.scerbak.ucl.usecases.usecases.StepSelector;
import sk.scerbak.ucl.usecases.usecases.SubGoal;
import sk.scerbak.ucl.usecases.usecases.Trigger;
import sk.scerbak.ucl.usecases.usecases.UseCase;
import sk.scerbak.ucl.usecases.usecases.UsecasesFactory;
import sk.scerbak.ucl.usecases.usecases.UsecasesPackage;
import sk.scerbak.ucl.usecases.usecases.Variant;
import sk.scerbak.ucl.usecases.usecases.Visibility;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model <b>Factory</b>.
 * <!-- end-user-doc -->
 * @generated
 */
public class UsecasesFactoryImpl extends EFactoryImpl implements UsecasesFactory
{
  /**
   * Creates the default factory implementation.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public static UsecasesFactory init()
  {
    try
    {
      UsecasesFactory theUsecasesFactory = (UsecasesFactory)EPackage.Registry.INSTANCE.getEFactory("http://www.scerbak.sk/ucl/usecases/Usecases"); 
      if (theUsecasesFactory != null)
      {
        return theUsecasesFactory;
      }
    }
    catch (Exception exception)
    {
      EcorePlugin.INSTANCE.log(exception);
    }
    return new UsecasesFactoryImpl();
  }

  /**
   * Creates an instance of the factory.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public UsecasesFactoryImpl()
  {
    super();
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public EObject create(EClass eClass)
  {
    switch (eClass.getClassifierID())
    {
      case UsecasesPackage.MODEL: return createModel();
      case UsecasesPackage.PACKAGE: return createPackage();
      case UsecasesPackage.USE_CASE: return createUseCase();
      case UsecasesPackage.SCOPE: return createScope();
      case UsecasesPackage.ACTOR: return createActor();
      case UsecasesPackage.INTEREST: return createInterest();
      case UsecasesPackage.STATE: return createState();
      case UsecasesPackage.CONDITION: return createCondition();
      case UsecasesPackage.TRIGGER: return createTrigger();
      case UsecasesPackage.ACTION_STEP: return createActionStep();
      case UsecasesPackage.ACTION: return createAction();
      case UsecasesPackage.ANY_ACTION: return createAnyAction();
      case UsecasesPackage.SUB_GOAL: return createSubGoal();
      case UsecasesPackage.INTERACTION: return createInteraction();
      case UsecasesPackage.SINGLE_STEP_SELECTOR: return createSingleStepSelector();
      case UsecasesPackage.STEP_RANGE_SELECTOR: return createStepRangeSelector();
      case UsecasesPackage.STEP_SELECTOR: return createStepSelector();
      case UsecasesPackage.STEP_LIST_SELECTOR: return createStepListSelector();
      case UsecasesPackage.ALL_STEPS_SELECTOR: return createAllStepsSelector();
      case UsecasesPackage.SCENARIO_END: return createScenarioEnd();
      case UsecasesPackage.GOTO: return createGoto();
      case UsecasesPackage.EXTENSION_STEP: return createExtensionStep();
      case UsecasesPackage.EXTENSION: return createExtension();
      case UsecasesPackage.VARIANT: return createVariant();
      case UsecasesPackage.ISSUE: return createIssue();
      default:
        throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier");
    }
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public Object createFromString(EDataType eDataType, String initialValue)
  {
    switch (eDataType.getClassifierID())
    {
      case UsecasesPackage.SCOPE_TYPE:
        return createScopeTypeFromString(eDataType, initialValue);
      case UsecasesPackage.VISIBILITY:
        return createVisibilityFromString(eDataType, initialValue);
      case UsecasesPackage.LEVEL:
        return createLevelFromString(eDataType, initialValue);
      case UsecasesPackage.SCENARIO_RESULT:
        return createScenarioResultFromString(eDataType, initialValue);
      default:
        throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier");
    }
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public String convertToString(EDataType eDataType, Object instanceValue)
  {
    switch (eDataType.getClassifierID())
    {
      case UsecasesPackage.SCOPE_TYPE:
        return convertScopeTypeToString(eDataType, instanceValue);
      case UsecasesPackage.VISIBILITY:
        return convertVisibilityToString(eDataType, instanceValue);
      case UsecasesPackage.LEVEL:
        return convertLevelToString(eDataType, instanceValue);
      case UsecasesPackage.SCENARIO_RESULT:
        return convertScenarioResultToString(eDataType, instanceValue);
      default:
        throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier");
    }
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public Model createModel()
  {
    ModelImpl model = new ModelImpl();
    return model;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public sk.scerbak.ucl.usecases.usecases.Package createPackage()
  {
    PackageImpl package_ = new PackageImpl();
    return package_;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public UseCase createUseCase()
  {
    UseCaseImpl useCase = new UseCaseImpl();
    return useCase;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public Scope createScope()
  {
    ScopeImpl scope = new ScopeImpl();
    return scope;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public Actor createActor()
  {
    ActorImpl actor = new ActorImpl();
    return actor;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public Interest createInterest()
  {
    InterestImpl interest = new InterestImpl();
    return interest;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public State createState()
  {
    StateImpl state = new StateImpl();
    return state;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public Condition createCondition()
  {
    ConditionImpl condition = new ConditionImpl();
    return condition;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public Trigger createTrigger()
  {
    TriggerImpl trigger = new TriggerImpl();
    return trigger;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public ActionStep createActionStep()
  {
    ActionStepImpl actionStep = new ActionStepImpl();
    return actionStep;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public Action createAction()
  {
    ActionImpl action = new ActionImpl();
    return action;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public AnyAction createAnyAction()
  {
    AnyActionImpl anyAction = new AnyActionImpl();
    return anyAction;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public SubGoal createSubGoal()
  {
    SubGoalImpl subGoal = new SubGoalImpl();
    return subGoal;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public Interaction createInteraction()
  {
    InteractionImpl interaction = new InteractionImpl();
    return interaction;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public SingleStepSelector createSingleStepSelector()
  {
    SingleStepSelectorImpl singleStepSelector = new SingleStepSelectorImpl();
    return singleStepSelector;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public StepRangeSelector createStepRangeSelector()
  {
    StepRangeSelectorImpl stepRangeSelector = new StepRangeSelectorImpl();
    return stepRangeSelector;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public StepSelector createStepSelector()
  {
    StepSelectorImpl stepSelector = new StepSelectorImpl();
    return stepSelector;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public StepListSelector createStepListSelector()
  {
    StepListSelectorImpl stepListSelector = new StepListSelectorImpl();
    return stepListSelector;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public AllStepsSelector createAllStepsSelector()
  {
    AllStepsSelectorImpl allStepsSelector = new AllStepsSelectorImpl();
    return allStepsSelector;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public ScenarioEnd createScenarioEnd()
  {
    ScenarioEndImpl scenarioEnd = new ScenarioEndImpl();
    return scenarioEnd;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public Goto createGoto()
  {
    GotoImpl goto_ = new GotoImpl();
    return goto_;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public ExtensionStep createExtensionStep()
  {
    ExtensionStepImpl extensionStep = new ExtensionStepImpl();
    return extensionStep;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public Extension createExtension()
  {
    ExtensionImpl extension = new ExtensionImpl();
    return extension;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public Variant createVariant()
  {
    VariantImpl variant = new VariantImpl();
    return variant;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public Issue createIssue()
  {
    IssueImpl issue = new IssueImpl();
    return issue;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public ScopeType createScopeTypeFromString(EDataType eDataType, String initialValue)
  {
    ScopeType result = ScopeType.get(initialValue);
    if (result == null) throw new IllegalArgumentException("The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'");
    return result;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public String convertScopeTypeToString(EDataType eDataType, Object instanceValue)
  {
    return instanceValue == null ? null : instanceValue.toString();
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public Visibility createVisibilityFromString(EDataType eDataType, String initialValue)
  {
    Visibility result = Visibility.get(initialValue);
    if (result == null) throw new IllegalArgumentException("The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'");
    return result;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public String convertVisibilityToString(EDataType eDataType, Object instanceValue)
  {
    return instanceValue == null ? null : instanceValue.toString();
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public Level createLevelFromString(EDataType eDataType, String initialValue)
  {
    Level result = Level.get(initialValue);
    if (result == null) throw new IllegalArgumentException("The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'");
    return result;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public String convertLevelToString(EDataType eDataType, Object instanceValue)
  {
    return instanceValue == null ? null : instanceValue.toString();
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public ScenarioResult createScenarioResultFromString(EDataType eDataType, String initialValue)
  {
    ScenarioResult result = ScenarioResult.get(initialValue);
    if (result == null) throw new IllegalArgumentException("The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'");
    return result;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public String convertScenarioResultToString(EDataType eDataType, Object instanceValue)
  {
    return instanceValue == null ? null : instanceValue.toString();
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public UsecasesPackage getUsecasesPackage()
  {
    return (UsecasesPackage)getEPackage();
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @deprecated
   * @generated
   */
  @Deprecated
  public static UsecasesPackage getPackage()
  {
    return UsecasesPackage.eINSTANCE;
  }

} //UsecasesFactoryImpl
